<template>
  <div class="theory-container">
    <router-view />
  </div>
</template>
  
  <script>
export default {
  name: "QuickLayout",
  created() {
    // this.adminLogin();
  },
  data() {
    return {
      loginForm: {},
    };
  },
  methods: {
    adminLogin() {
      this.loginForm.username = "admin";
      this.loginForm.password = "lxl123456";
      this.handleLogin();
    },
    handleLogin() {
      this.$refs.loginForm.validate((valid) => {
        if (valid) {
          this.loading = true;
          this.$store
            .dispatch("user/login", this.loginForm)
            .then(() => {
              this.$router.push({
                path: this.redirect || "/",
                query: this.otherQuery,
              });
              this.loading = false;
            })
            .catch(() => {
              this.loading = false;
            });
        } else {
          console.log("提交错误！");
          return false;
        }
      });
    },
  },
};
</script>
  
<style scoped>
.theory-container {
  /* padding: 20px; */
}
</style>